home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / YLIB / ylib_0_10 / fpa_errors < prev    next >
Text File  |  1993-09-20  |  7KB  |  175 lines

  1. estimates of errors :
  2. The routines were compared with VAX real*16 routines. Given below are
  3. the range of arguments tested, the number of entries tested, the
  4. maximum observed error and the root mean square error.
  5. The arguments were produced at random.
  6. The result of the routines was kept in extended precision.
  7. Note that for some routines there is no way to avoid loss of signifiance for
  8. some range of arguments. This is true for example for the trigonometric
  9. functions at large arguments.
  10.  
  11. Note that the double precision accuracy is about 0.2e-15 ( 1 + 0.2e-15 != 1).
  12.  
  13.  
  14.  
  15. sqrt
  16.  relative error
  17.    range of |arg|      #entries   max_err     rms_err
  18.  
  19. [ 0.000E+00, 0.316    ]    2018   0.304E-17   0.146E-17
  20. [ 0.316    ,  3.16    ]   18169   0.301E-17   0.145E-17
  21. [  3.16    ,  31.6    ]    2011   0.305E-17   0.151E-17
  22. [  31.6    ,  316.    ]    1908   0.304E-17   0.143E-17
  23. [  316.    , 0.316E+04]    1019   0.308E-17   0.160E-17
  24. [ 0.316E+04, 0.316E+05]     969   0.303E-17   0.151E-17
  25. [ 0.316E+05,          ]     906   0.304E-17   0.149E-17
  26. ---------------------
  27. exp(x)
  28.  relative error
  29. [ 0.000E+00, 0.693    ]    6987   0.148E-17   0.643E-18
  30. [ 0.693    ,  6.93    ]   14591   0.134E-17   0.598E-18
  31. [  6.93    ,  69.3    ]    2084   0.347E-16   0.491E-17
  32. [  69.3    ,  693.    ]    2338   0.521E-16   0.190E-16
  33. ---
  34. 2**x
  35.  relative error
  36. [ 0.000E+00, 0.100    ]     983   0.124E-17   0.671E-18
  37. [ 0.100    ,  1.00    ]    9174   0.149E-17   0.634E-18
  38. [  1.00    ,  10.0    ]   12073   0.301E-17   0.633E-18
  39. [  10.0    ,  100.    ]    2179   0.221E-16   0.743E-17
  40. [  100.    , 0.100E+04]    1591   0.233E-16   0.987E-17
  41. -----------------
  42. exp(x)-1
  43.  relative error
  44. [ 0.000E+00,  1.00    ]    9927   0.565E-17   0.209E-17
  45. [  1.00    ,  2.00    ]   10073   0.151E-17   0.591E-18
  46. -----------------
  47. for log and log10 there is a loss of significance as x-> 0.
  48. log
  49.  absoulute error
  50. [ 0.000E+00, 0.100    ]     634   0.214E-17   0.204E-18
  51. [ 0.100    ,  1.00    ]    5751   0.504E-18   0.182E-18
  52. [  1.00    ,  10.0    ]   14310   0.599E-18   0.191E-18
  53. [  10.0    ,  100.    ]    1938   0.800E-18   0.208E-18
  54. [  100.    , 0.100E+04]    1716   0.102E-17   0.272E-18
  55. [ 0.100E+04, 0.100E+05]    1007   0.342E-17   0.871E-18
  56. [ 0.100E+05,          ]    1644   0.376E-17   0.159E-17
  57. ----------------
  58. log10
  59.  absoulute error
  60. [ 0.000E+00, 0.100    ]     634   0.428E-18   0.182E-18
  61. [ 0.100    ,  1.00    ]    5751   0.417E-18   0.108E-18
  62. [  1.00    ,  10.0    ]   14310   0.392E-18   0.698E-19
  63. [  10.0    ,  100.    ]    1938   0.441E-18   0.171E-18
  64. [  100.    , 0.100E+04]    1716   0.506E-18   0.164E-18
  65. [ 0.100E+04, 0.100E+05]    1007   0.506E-18   0.180E-18
  66. [ 0.100E+05,          ]    1644   0.652E-18   0.235E-18
  67. -----------------
  68. sin
  69.  relative error
  70. [ 0.000E+00,  1.57    ]   10045   0.880E-18   0.275E-18
  71.  absoulute error
  72. [  1.57    ,  15.7    ]   11057   0.340E-17   0.335E-18
  73. [  15.7    ,  157.    ]    1924   0.343E-16   0.722E-17
  74. [  157.    , 0.157E+04]    1526   0.341E-15   0.626E-16
  75. [ 0.157E+04, 0.157E+05]     993   0.363E-14   0.657E-15
  76. [ 0.157E+05, 0.157E+06]     978   0.347E-13   0.710E-14
  77. [ 0.157E+06,          ]     477   0.373E-13   0.110E-13
  78. ----
  79. cos
  80.  absoulute error
  81. [ 0.000E+00,  1.57    ]   10045   0.605E-18   0.197E-18
  82. [  1.57    ,  15.7    ]   11057   0.356E-17   0.337E-18
  83. [  15.7    ,  157.    ]    1924   0.364E-16   0.700E-17
  84. [  157.    , 0.157E+04]    1526   0.317E-15   0.599E-16
  85. [ 0.157E+04, 0.157E+05]     993   0.344E-14   0.697E-15
  86. [ 0.157E+05, 0.157E+06]     978   0.365E-13   0.693E-14
  87. [ 0.157E+06,          ]     477   0.342E-13   0.113E-13
  88. --------------------------
  89. tan
  90. for all known methods there is a serious loss of significance near
  91. x = pi/2 (and multiples thereof).
  92.   relative error
  93. [ 0.000E+00, 0.196    ]    1241   0.442E-18   0.110E-18
  94. [ 0.196    , 0.393    ]    1252   0.260E-18   0.759E-19
  95. [ 0.393    , 0.785    ]    2498   0.589E-18   0.190E-18
  96. [ 0.785    ,    pi    ]    5054   0.217E-14   0.305E-16
  97.  
  98. the error in the last interval is meaningless, you should therefore look
  99. at the interval
  100.  
  101. [ 0.0   , pi/2-1/1000]   10037   0.232E-16   0.622E-18
  102. ---------------------------------------
  103. asin
  104.  relative error
  105. [ 0.000E+00, 0.707    ]   14132   0.446E-17   0.150E-17
  106. [ 0.707    ,  1.00    ]    5868   0.214E-17   0.762E-18
  107. ------------------------
  108. acos
  109.  absoulute error
  110. [ 0.000E+00, 0.707    ]   14132   0.169E-17   0.528E-18
  111. [ 0.707    ,  1.00    ]    5868   0.170E-17   0.618E-18
  112. -----------------------
  113. atan
  114.  relative error
  115. [ 0.000E+00, 0.707    ]    7133   0.268E-17   0.482E-18
  116. [ 0.707    ,  7.07    ]   14451   0.494E-18   0.189E-18
  117. [  7.07    ,  70.7    ]    1914   0.238E-18   0.106E-18
  118. [  70.7    ,  707.    ]    1275   0.198E-18   0.101E-18
  119. [  707.    , 0.707E+04]    1026   0.197E-18   0.999E-19
  120. [ 0.707E+04, 0.707E+05]     919   0.197E-18   0.997E-19
  121. [ 0.707E+05,          ]     282   0.196E-18   0.995E-19
  122. -----------------------
  123. sinh
  124.  relative error
  125. [ 0.000E+00,  1.00    ]   10157   0.229E-17   0.725E-18
  126. [  1.00    ,  10.0    ]   12073   0.428E-17   0.739E-18
  127. [  10.0    ,  100.    ]    2179   0.372E-16   0.115E-16
  128. [  100.    , 0.100E+04]    1591   0.519E-16   0.194E-16
  129. ------------------------------------
  130. cosh
  131.  relative error
  132. [ 0.000E+00,  1.00    ]   10157   0.847E-18   0.326E-18
  133. [  1.00    ,  10.0    ]   12073   0.428E-17   0.633E-18
  134. [  10.0    ,  100.    ]    2179   0.372E-16   0.115E-16
  135. [  100.    , 0.100E+04]    1591   0.519E-16   0.194E-16
  136. -----------------------------------
  137. tanh
  138.  relative error
  139. [ 0.000E+00,  1.00    ]   10155   0.546E-17   0.146E-17
  140. [  1.00    ,  10.0    ]   12038   0.611E-18   0.206E-18
  141. [  10.0    ,  100.    ]    1912   0.320E-18   0.588E-19
  142. [  100.    , 0.100E+04]    1002   0.000E+00   0.000E+00
  143. [ 0.100E+04, 0.100E+05]    1007   0.000E+00   0.000E+00
  144. [ 0.100E+05, 0.100E+06]     886   0.000E+00   0.000E+00
  145. ---------------------------
  146. atan2(x,y)
  147.  is basically the atan routine. I give stats for both |x| and |y|
  148.  between 0 and 1.e5
  149. relative error
  150. [ 0.000E+00, 0.100E+6]   17500   0.429E-17   0.293E-18
  151. -----------------------------------------
  152. pow(x,y)
  153.  is calculated as exp(y*ln(x))
  154.  the error can be obtained in more detail from the errors of exp and ln
  155.  we give typical examples where the range given is the one of the result
  156.  
  157.   relative error
  158. [ 0.000E+00, 0.100E-02]    1737   0.189E-15   0.431E-16
  159. [ 0.100E-02, 0.100E-01]     228   0.113E-16   0.118E-17
  160. [ 0.100E-01, 0.100    ]     446   0.284E-17   0.828E-18
  161. [ 0.100    ,  1.00    ]    5054   0.215E-17   0.653E-18
  162. [  1.00    ,  10.0    ]    4958   0.287E-17   0.656E-18
  163. [  10.0    ,  100.    ]     452   0.222E-17   0.723E-18
  164. [  100.    , 0.100E+04]     235   0.277E-17   0.998E-18
  165. [ 0.100E+04, 0.100E+05]     158   0.468E-17   0.138E-17
  166. [ 0.100E+05, 0.000E+00]    1732   0.199E-15   0.415E-16
  167. -----------------------------
  168. pow(x,y)
  169.  where y is an integer
  170.   relative error
  171.  x is used a range
  172. [ 0.000E+00,  1.00    ]    5245   0.314E-17   0.154E-18
  173. [  1.00    ,  10.0    ]    7539   0.352E-16   0.804E-18
  174. [  10.0    ,  100.    ]    2216   0.450E-16   0.835E-17
  175.